<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // DB::table('users')->insert([
        //     'name' => str_random(10),
        //     'email' => str_random(10).'@gmail.com',
        //     'password' => bcrypt('secret'),
        // ]);
       
        // DB::table('s_teacher_info')->insert([
        //     'name' => str_random(10),
        //     'headimg' => '微信图片_20181104114739.jpg',
        //     'type' => mt_rand(1,3),
        //     'tags_zh_cn' => str_random(10),
        //     'tags_en' => str_random(10),
        //     'certification_zh_cn' => str_random(10),
        //     'certification_en' => str_random(10),
        //     'desc_zh_cn' => str_random(10),
        //     'desc_en' => str_random(10),

        // ]);

        $now = Carbon::now()->startOfDay();
        for ($i=1; $i < 20; $i++) {
            $d = $now->copy()->addDays($i);
            for ($t=1; $t < 51; $t++) { 
                DB::table('s_tea_schedule_info')->insert([
                    'teacher_id' => $t,
                    'date_time' => $d->toDateString(),
                    'time_0800' => '-1',
                    'time_0830' => '-1',
                    'time_0900' => '-1',
                    'time_0930' => '-1',
                    'time_1000' => '-1',
                    'time_1030' => '-1',
                    'time_1100' => '-1',
                    'time_1130' => '-1',
                    'time_1200' => '-1',
                    'time_1230' => '-1',
                    'time_1300' => '-1',
                    'time_1330' => '-1',
                    'time_1400' => '-1',
                    'time_1430' => '-1',
                    'time_1500' => '-1',
                    'time_1530' => '-1',
                    'time_1600' => '-1',
                    'time_1630' => '-1',
                    'time_1700' => '-1',
                    'time_1730' => '-1',
                    'time_1800' => '-1',
                    'time_1830' => '-1',
                    'time_1900' => '-1',
                    'time_1930' => '-1',
                    'time_2000' => '-1',
                    'time_2030' => '-1',
                    'time_2100' => '-1',
                    'time_2130' => '-1',
                    'time_2200' => '-1',
                    'time_2230' => '-1',
                    'time_2300' => '-1',
                    'time_2330' => '-1',
                    'created_at' => $d

                ]);
            }
        }
    }
}
